//
//  DataBaseSaveEditeImageModel.h
//  WuliHanhan
//
//  Created by tang on 16/3/16.
//  Copyright © 2016年 LVpeng. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Header.h"



typedef void(^getDataModel)(NSArray *namearray, NSArray *imageDataArray);
typedef void(^getImage)(NSData *imageData, NSData *cropeData, NSDictionary *qipaoDic);
typedef void (^getUpLoadImageData)(NSData *data, NSData *sourceData, NSString *imageConnectID);
typedef void(^getYaSuo)(NSData *yasuoImageData, NSString *nameString);

@interface DataBaseSaveEditeImageModel : NSObject


SINGLETON_INTERFACE(DataBaseSaveEditeImageModel);









//打开数据库
- (void)openDataBase;


#pragma mark-----new

//写入图片信息
- (void)writeImageData:(NSData *)imageData withCropData:(NSData *)data withTopView:(NSDictionary *)dic withImageIndexName:(NSString *)name withPostImage:(NSData *)postData withConnectID:(NSString *)connectIDString withYasuo:(NSData *)yssuoData;

//写入裁剪图片
- (void)writeCropeImage:(NSData *)data witnName:(NSString *)name;

//删除照片
- (void)deleteSelectImageWithName:(NSString *)name;



//写入气泡图片裁剪信息
- (void)writeCropIMage:(NSData *)imageData withQipaoInfo:(NSDictionary *)infoDic witnName:(NSString *)name;


- (void)readUpLoadImageWithName:(NSString *)name withCallBack:(getUpLoadImageData)callBack;


#pragma mark-----



//关闭shujuku
- (void)closeDataBase;


//插入数据
- (void)insertImage:(NSData *)data withIndex:(NSString *)indexString;


//插入图片信息包括移动信息
- (void)insertImageWithInfo:(NSDictionary *)dic withImage:(NSData *)data withImageName:(NSString *)nameString;


//删除
- (void)deletaIMage:(NSString *)indesString;

//获取相册数据库的照片
- (void)rearDataBaseForPhotos:(getDataModel)callBack;

//获取数据库的照片
- (void)rearDataBaseImageWithName:(NSString *)nsme andWriteIMageWithlast:(NSString *)lastIMageName getImage:(getImage)callBack;

//更新图片信息
- (void)updateImageInfo:(NSDictionary *)info withCellindex:(NSString *)currentIndex;


//获取头部压缩图
- (void)readYaSuoImage:(getYaSuo)callBack;


//拍照结束添加图片index加1
- (void)updateDataBaseWithIndex;


@end
